from . import flutter

TextStyle = flutter.TextStyle
Container = flutter.Container
Center = flutter.Center
Text = flutter.Text
Stack = flutter.Stack
Positioned = flutter.Positioned
Transform = flutter.Transform
LinearGradient = flutter.LinearGradient
Colors = flutter.Colors
TextAlign = flutter.TextAlign
EdgeInsets = flutter.EdgeInsets
FontWeight = flutter.FontWeight
FontStyle = flutter.FontStyle
BoxShadow = flutter.BoxShadow
BoxShape = flutter.BoxShape
RichText = flutter.RichText
TextSpan = flutter.TextSpan
TextOverflow = flutter.TextOverflow
BorderRadius = flutter.BorderRadius
Offset = flutter.Offset
Scaffold = flutter.Scaffold
AppBar = flutter.AppBar
IconButton = flutter.IconButton
Icon = flutter.Icon
Icons = flutter.Icons
TextButton = flutter.TextButton
OutlinedButton = flutter.OutlinedButton
ContainedButton = flutter.ContainedButton
Column = flutter.Column
Card = flutter.Card
ListTile = flutter.ListTile
ButtonBar = flutter.ButtonBar
FlatButton = flutter.FlatButton
MainAxisAlignment = flutter.MainAxisAlignment
Text = flutter.Text
FlatButton = flutter.FlatButton
Color = flutter.Colors
Children = flutter.Children

# Clip = flutter.Clip


def cards():
    return Scaffold(
        appBar=AppBar(
            title=Text('Cards'),
            leading=Icon(Icons.arrow_back, href="http://localhost:8000/web/_main_.html"),
            actions=[
                Icon(Icons.refresh, href='cards.html')
            ]
        ),
        body=Children(
            children=[
                Card(
                    clipBehavior=None,
                    priActions=[
                            ListTile(
                                leading=Icon(Icons.school),
                                title=Text('Sun Yat-sen University'),
                                subtitle=Text(
                                    'A beautiful university! ',
                                    # style=TextStyle(color=Colors.black.withOpacity(0.6))
                                ),
                                color='green'
                            ),
                    ],
                    actions=ButtonBar(
                                alignment=MainAxisAlignment.start,
                                children=[
                                    TextButton(
                                        icon=Icon(Icons.favorite),
                                        label=Text("LOVE"),
                                    ),
                                    TextButton(
                                        icon=Icon(Icons.star),
                                        label=Text("Collect"),
                                    ),
                                    TextButton(
                                        icon=Icon(Icons.adobe),
                                        label=Text("Best"),
                                    ),
                                    TextButton(
                                        icon=Icon(Icons.start),
                                        label=Text("Great"),
                                    )
                                ],
                            ),
                            # Image.asset('assets/card-sample-image.jpg'),
                            # Image.asset('assets/card-sample-image-2.jpg'),
                ),
            ],
        ),
    )


def run_app():
    test_ = cards()
    javascript.document.body.appendChild(test_.render())
run_app()